<?php
	echo "<div id='video_page'>";
	echo "<h2>Videos</h2>";
	if (isset($videos) && is_array($videos) && (!empty($videos))) {
		
		foreach ($videos as $video) {
			echo "<div id='video_row'>";
			$link = "/site/".$organization['Organization']['alias']."/videos/".$video['id'];
			$link = Router::url($link, true);

			echo "<div id='yt_image_video'>";
			echo "<a id='yt_thumbnail' href='".$link."' >";
			echo "<div id='yt_thumbnail_ext'>";
			echo "<div id='yt_thumbnail'>";
			echo "<img id='yt_thumbnail' src='../../img/i_play.gif' style=\"background-image: url(".$video['thumbnail'].");\" '/>";
			echo "</div>"; // id='yt_thumbnail'
			echo "<div id='corner_text'>";
			$duration="".(($video['duration']-$video['duration']%60)/60) . ":" .sprintf("%02d",$video['duration']%60);
			echo "<span id='duration'>".$duration."</span>";
			echo "</div>"; // id='corner_text'
			echo "</div>"; // id='yt_thumbnail_ext'
			echo "</a>";
			echo "</div>"; //id='yt_image_video'
			
			echo "<div id='yt_desc'>";
			echo "<h3><a class='link_video_title' href='".$link."'>".$video['name']."</a></h3>";
			echo "<p>".$video['description']."</p>";
			echo "<p><a class='link_video_title' href='".$video['url']."'>Clique aqui para ver o video no YouTube</a></p>";
			echo "</div>"; // id='yt_desc'
			
			echo "</div>"; // id='video_row' 
		}
	
	}else{
		echo "<div><p>A ONG e/ou Entidade Filantrópica não disponibilizou nenhum Video até o momento.</p></div>";
	}
	echo "</div>";
 